﻿using Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZR.Infrastructure.Helper
{

    public static class LogHelper
    {
        static ILogger Logger;
        static LogHelper()
        {
            Logger = InternalApp.ServiceProvider.GetService<ILoggerFactory>().CreateLogger("CKS.Server");
        }

        public static void Information(string message, params object?[] args)
        {
            Logger.LogInformation(message, args);
        }

        public static void WriteError(Exception ex, string message)
        {
            Logger.LogError(ex, message);
        }

        public static void WritePlcLog(string message)
        {
            Logger.LogInformation(message);
        }
    }

    class MainLog { }
    
}
